#ifndef WIDGET_H
#define WIDGET_H

#include <QWidget>
#include "mycal.h"
#include <QtMultimedia/QMediaPlayer>
#include <QKeyEvent>
//#include <qtextstream.h>
#include <QFile>
//#include <qfile.h>

#define MAXNUM 100

QT_BEGIN_NAMESPACE
namespace Ui { class Widget; }
QT_END_NAMESPACE

class Widget : public QWidget
{
    Q_OBJECT

public:
    Widget(QWidget *parent = nullptr);
    void keyPressEvent(QKeyEvent *event);
    ~Widget();

private slots:
    void on_oneButton_clicked();

    void on_twoButton_clicked();

    void on_threeButton_clicked();

    void on_fourButton_clicked();

    void on_fiveButton_clicked();

    void on_sixButton_clicked();

    void on_sevenButton_clicked();

    void on_eightButton_clicked();

    void on_nineButton_clicked();

    void on_zeroButton_clicked();

    void on_leftButton_clicked();

    void on_rightButton_clicked();

    void on_divButton_clicked();

    void on_mulButton_clicked();

    void on_subButton_clicked();

    void on_addButton_clicked();

    void on_cleButton_clicked();

    void on_delButton_clicked();

    void on_equButton_clicked();

    void on_pointButton_clicked();

    void on_sinButton_clicked();

    void on_cosButton_clicked();

    void on_tanButton_clicked();

    void on_arcsinButton_clicked();

    void on_arccosButton_clicked();

    void on_arctanButton_clicked();

    void on_InButton_clicked();

    void on_miButton_clicked();

    void on_PIButton_clicked();

    void on_eButton_clicked();

    void on_sqrt_clicked();

    void on_dButton_clicked();

    void on_factoricalButton_clicked();

private:
    Ui::Widget *ui;
    QMediaPlayer *startSound;
    QString expression,realexp;
    int leftNum=0,rightNum=0;
    bool isError=false,canEqu=true;
    int voice=100;
};
#endif // WIDGET_H
